var random = Math.floor(Math.random()*2+1);
var status = 0;

function start() {
	status = -1;
	action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0 && status == 0) {
			cm.dispose();
			return;
		}
		if (mode == 1)
			status++;
		else
			status--;
		if (status == 0) {
			cm.sendNext("Hello #h #, I am a #rStatue#k and i randomly give fame!\r\nHowever, there is also a chance that i take fame!\r\nSo, be careful whether you click Next or not!");
		}
		if (status == 1) {
			if (random == 1) {
				cm.sendOk("Aww, too bad, i'm taking 1 #bfame#k from you");
				cm.gainFame(-1);
				cm.dispose();
			} else {
				cm.sendOk("Good! i will give you 1 #bfame#k!");
				cm.gainFame(1);
				cm.dispose();
			}
		}
	}
}